<template>
	<view>
		<home-info class="home-info" :homeinfo="homeinfo"></home-info>
		<view class="list-content">
			<view class="list">
				<view class="li noborder" >
					<view class="icon"><image src="../../static/img/card.png"></image></view>
					<view class="text">我的名片</view>
					<image class="to" src="../../static/img/to.png"></image>
				</view>
			</view>
			<view class="list">
			<!-- 	<view class="li " @click="changeSkin">
					<view class="icon"><image src="../../static/img/skin.png"></image></view>
					<view class="text">主题切换</view>
					<image class="to" src="../../static/img/to.png"></image>
				</view> -->
				<view class="li " >
					<view class="icon"><image src="../../static/img/help.png"></image></view>
					<view class="text">帮助中心</view>
					<image class="to" src="../../static/img/to.png"></image>
				</view>
				<view class="li " >
					<view class="icon"><image src="../../static/img/about.png"></image></view>
					<view class="text">关于我们</view>
					<image class="to" src="../../static/img/to.png"></image>
				</view>
				<view class="li " >
					<view class="icon"><image src="../../static/img/opinion.png"></image></view>
					<view class="text">意见反馈</view>
					<image class="to" src="../../static/img/to.png"></image>
				</view>
			</view>
<!-- 			<view class="list">
				<view class="li noborder" >
					<view class="icon"><image src="../../static/img/set.png"></image></view>
					<view class="text">系统设置</view>
					<image class="to" src="../../static/img/to.png"></image>
				</view>
			</view> -->
			<view class="list" @tap="clickevent">
				<view class="li noborder" >
					<view class="icon"><image src="../../static/img/out.png"></image></view>
					<view class="text">退出登陆</view>
					<image class="to" src="../../static/img/to.png"></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	var loginRes;
	import homeListItem from "../../components/home/home-list-item.vue";
	import homeInfo from "../../components/home/home-info.vue";
	import otherLogin from "../../components/home/other-login.vue";
	import homeData from "../../components/home/home-data.vue";
	import uniIcons from "@/components/uni-icons/uni-icons.vue"
	export default {
		components:{
			homeListItem,
			homeInfo,
			otherLogin,
			homeData,
			uniIcons
		},
		data() {
			return {
				homeinfo:{},
				homedata:[
					{ name:"糗事", num:0 },
					{ name:"动态", num:0 },
					{ name:"评论", num:0 },
					{ name:"收藏", num:0 },
				],
				list:[
					{ icon:"star-filled",name:"关于APP",clicktype:"navigateTo",url:"" },
					{ icon:"heart-filled",name:"关于公司",clicktype:"navigateTo",url:""},
					{ icon:"flag-filled",name:"公司官网",clicktype:"navigateTo",url:''},
					{ icon:"person-filled",name:"联系我们",clicktype:"navigateTo",url:"" },
					{ icon:"info-filled",name:"服务条款",clicktype:"navigateTo",url:"" },
					// { icon:"keyboard",name:"清除缓存",clicktype:"clear",url:"" },
					// { icon:"liulan",name:"修改密码",clicktype:"navigateTo",url:"/pages/changepsd/changepsd"},
					// { icon:"huiyuanvip",name:"身份认证",clicktype:"navigateTo",url:''},
					// { icon:"keyboard",name:"退出登陆",clicktype:"logout",url:"" },
				]
			};
		},
		onNavigationBarButtonTap(e) {
			if(e.index==0){
				uni.navigateTo({
					url: '../user-set/user-set',
				});
			}
		},
		onLoad() {
			// loginRes = this.checkLogin('../index/index', '2');
			// if(!loginRes){return false;}
			// this.getUserInfo()
		},
		onShow() {
			loginRes = this.checkLogin('../index/index', '2');
			if(!loginRes){return false;}
			this.getUserInfo()
		},
		methods:{
			async getUserInfo(){				
				// let [err,res]=await this.$http.post("/selectCom_user",{user: uni.getStorageSync('name')})
				// // console.log(res,999)
				// if(!!res.data){
				// 	this.homeinfo=res.data
				// 	this.$set(this.list[2],'url',`/pages/authentication/authentication?homeinfo=${JSON.stringify(this.homeinfo)}`)
				// }
			},
			clickevent(){
				uni.showModal({
					title: '提示',
					content: '是否要退出登陆？',
					confirmText: '立刻退出',
					success: res => {
						if(res.confirm){
							this.User.logout(true)
							// uni.showToast({ title: '退出登陆成功！'});
						}
					},
				});
			}
		}
	}
</script>

<style lang="less" scoped>	
page{
	background-color:#f1f1f1;
	font-size: 30upx;
}	
.home-list{
	margin-top: 40upx;
	padding: 20upx;
	background: #fff;
}
.list-content{
	background: #fff;
}
.list{
	width:100%;
	border-bottom:15upx solid  #f1f1f1;
	background: #fff;
	&:last-child{
		border: none;
	}
	.li{
		width:92%;
		height:100upx;
		padding:0 4%;
		border-bottom:1px solid rgb(243,243,243);
		display:flex;
		align-items:center;
	&.noborder{
		border-bottom:0
		}
		.icon{
			flex-shrink:0;
			width:50upx;
			height:50upx;
			image{
				width:50upx;
				height:50upx;
			}
		}
		.text{
			padding-left:20upx;
			width:100%;
			color:#666;
		}
		.to{
			flex-shrink:0;
			width:40upx;
			height:40upx;
		}
	}
}

</style>
